import requests
import execjs
import json
headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36',
}


post_data = {
    "inviteMethod": "",
    "businessClassfication": "",
    "mc": "",
    "lx": "ZBGG",
    "dwmc": "",
    "pageIndex": 3
}
execjs_ctx = execjs.compile(open('./五矿.js').read())
r=requests.post('https://ec.minmetals.com.cn/open/homepage/public', headers=headers).text
print(r)
execjs_code = execjs_ctx.call('get_param',post_data,r)
print(execjs_code)
json_data = {
    'param': execjs_code
}
response = requests.post(
    'https://ec.minmetals.com.cn/open/homepage/zbs/by-lx-page',
    headers=headers,
    json=json_data,
)
print(response.text)
